﻿using System;
using System.Data;

namespace Light.Framework
{
    /// <summary>
    /// 数据字段信息：来自属性的ColumnAttribute 特性
    /// </summary>
    public class BelongsInfo
    {
        /// <summary>
        /// 默认构造函数，同类型递归深度为 0
        /// </summary>
        public BelongsInfo()
        {
            RecursiveDeep = 0;
        }

        /// <summary>
        /// 对应的属性名
        /// </summary>
        public string PropertyName { get; set; }

        /// <summary>
        /// 数据库字段名
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 表别名
        /// </summary>
        public string Alias { get; set; }

        /// <summary>
        /// 递归深度
        /// </summary>
        public int RecursiveDeep { get; set; }

        /// <summary>
        /// 引用表别名 from user u join company c on u.CompanyID=c.ID  这里的 AliasReference=u
        /// </summary>
        public string AliasReference { get; set; }

        /// <summary>
        ///实体类型
        /// </summary>
        public Type Type { get; set; }

        /// <summary>
        /// join表连接方式
        /// </summary>
        public JoinBehaviour JoinBehaviour { get; set; }

        /// <summary>
        /// 是否只用于查询，不保存此值
        /// </summary>
        public bool ReadOnly { get; set; }
    }
}
